local skel = fk.CreateSkill {
  name = "emo__fenshi",
  tags = {Skill.Wake},
  dynamic_desc = function (self, player, lang)
    if player:usedSkillTimes(self.name, Player.HistoryGame) == 0 then
      return "emo__fenshi_dyn:".. player:getMark("emo__caiqing_count")
    end
  end,
}

Fk:loadTranslationTable{
  ["emo__fenshi"] = "焚诗",
  [":emo__fenshi"] = "觉醒技，当你受到伤害后，若你已因“才情”弃置至少三张牌，则你失去“才情”获得技能〖焚稿〗并增加1点体力上限。",
  [":emo__fenshi_dyn"] = "觉醒技，当你受到伤害后，若你已因“才情”弃置至少三张牌（已弃：{1}），则你失去“才情”获得技能〖焚稿〗并增加1点体力上限。",

  ["$emo__fenshi1"] = "泪滴成珠映孤颜，心如玉碎断无言",
}

skel:addEffect(fk.Damaged, {
  can_trigger = function (self, event, target, player, data)
    return target == player and player:hasSkill(skel.name) and player:usedSkillTimes(skel.name, Player.HistoryGame) == 0
  end,
  can_wake = function (self, event, target, player, data)
    return player:getMark("emo__caiqing_count") >= 3
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    room:setPlayerMark(player, "emo__caiqing_remove", 1)
    room:handleAddLoseSkills(player, "emo__fengao")
    if player:isAlive() then
      room:changeMaxHp(player, 1)
    end
  end,
})

return skel
